<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php echo $this->Html->charset(); ?>        
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <title>
            <?php $cakeDescription = __d('cake_dev', 'SISTEMA'); ?>
            <?php echo $cakeDescription ?>:
            <?php echo $title_for_layout; ?>        
        </title>

        <?php
        echo $this->Html->css(array(
            'styles', array('media' => 'print')
                //'modal',
        ));
        ?>
        <?php
        
        echo $this->Html->script(array(
            'jquery-1.8.2.min',
            'jquery-ui-1.9.1.custom.min',
            'jquery.sheepItPlugin.min'
        ));
        ?>

        <?php
        echo $this->Html->script(array(
            'plugins/forms/ui.spinner',
            'plugins/forms/jquery.mousewheel',
            'jquery.bpopup.min',
            'jquery.qrcode'
        ));
        ?>  

        <?php
        echo $this->Html->script(array(
//            'plugins/charts/excanvas.min',
//            'plugins/charts/jquery.flot',
//            'plugins/charts/jquery.flot.orderBars',
//            'plugins/charts/jquery.flot.pie',
//            'plugins/charts/jquery.flot.resize',
            'plugins/charts/jquery.sparkline.min'
        ));
        ?>

        <?php
        echo $this->Html->script(array(
            'plugins/tables/jquery.dataTables',
            'plugins/tables/jquery.sortable',
            'plugins/tables/jquery.resizable',
        ));
        ?>  

        <?php
        echo $this->Html->script(array(
            'plugins/forms/autogrowtextarea',
            'plugins/forms/jquery.uniform',
            'plugins/forms/jquery.inputlimiter.min',
            'plugins/forms/jquery.tagsinput.min',
            'plugins/forms/jquery.maskedinput.min',
            'plugins/forms/jquery.autotab',
            'plugins/forms/jquery.chosen.min',
            'plugins/forms/jquery.dualListBox',
            'plugins/forms/jquery.cleditor',
            'plugins/forms/jquery.ibutton',
            'plugins/forms/jquery.validationEngine-en',
            'plugins/forms/jquery.validationEngine'
        ));
        ?>

        <?php
        echo $this->Html->script(array(
            'plugins/uploader/plupload',
            'plugins/uploader/plupload.html4',
            'plugins/uploader/plupload.html5',
            'plugins/uploader/jquery.plupload.queue'
        ));
        ?>        

        <?php
        echo $this->Html->script(array(
            'plugins/wizards/jquery.form.wizard',
            'plugins/wizards/jquery.validate',
            'plugins/wizards/jquery.form'
        ));
        ?>  

        <?php
        echo $this->Html->script(array(
            'plugins/ui/jquery.collapsible.min',
            'plugins/ui/jquery.breadcrumbs',
            'plugins/ui/jquery.tipsy',
            'plugins/ui/jquery.progress',
            'plugins/ui/jquery.timeentry.min',
            'plugins/ui/jquery.colorpicker',
            'plugins/ui/jquery.jgrowl',
            'plugins/ui/jquery.fancybox',
            'plugins/ui/jquery.fileTree',
            'plugins/ui/jquery.sourcerer'
        ));
        ?>

        <?php
        echo $this->Html->script(array(
            'plugins/others/jquery.fullcalendar',
            'plugins/others/jquery.elfinder'
        ));
        ?>     

        <?php
        echo $this->Html->script(array(
            'plugins/ui/jquery.easytabs.min',
            'files/bootstrap',
            'files/functions'
        ));
        
        ?> 

        <?php
            echo $this->fetch('meta');
            echo $this->fetch('css');
            echo $this->fetch('script');
        ?>
        <!--[if IE]> <link href="css/ie.css" rel="stylesheet" type="text/css"> <![endif]-->        
        <style>
            input{
                font-size: large;
            }
        </style>
    </head>
    <body>
        <!-- Top line begins -->
        <div id="top">
            <div class="wrapper">
                <a href="index.html" title="" class="logo">
                    <?php echo $this->Html->image('epcm/logo1.png') ?>
                    <!--
                        <img src="images/logo1.png" alt="" />
                    -->
                </a>
                <!-- Right top nav -->
                <div class="topNav">
                    <ul class="userNav">

                        <?php //echo $this->Html->link('Cerrar Sesion', array('controller'=>'Users', 'action'=>'logout','id'=>'logeo')) ?>                  
                        <a href="<?php echo $this->Html->url(array('controller' => 'Users', 'action' => 'logout')); ?>" id="logeo">Cerrar Sesion</a>
                        <?php echo $this->Html->image('epcm/logo2.png') ?> 

                    </ul>
                </div>
                <div class="clear"></div>
                <!-- Responsive nav -->
                <ul class="altMenu">
                    <li><a href="index.html" title="">Dashboard</a></li>
                    <li><a href="ui.html" title="" class="exp" id="current">UI elements</a>
                        <ul>
                            <li><a href="ui.html">LISTADO DE TAGS</a></li>
                            <li><a href="ui_icons.html">Icons</a></li>
                        </ul>
                    </li>

                    <li><a href="other_calendar.html" title="" class="exp">Other pages</a>
                        <ul>
                            <li><a href="other_calendar.html">Calendar</a></li>
                            <li><a href="other_gallery.html">Images gallery</a></li>
                            <li><a href="other_file_manager.html">File manager</a></li>
                            <li><a href="other_404.html">Sample error page</a></li>
                            <li><a href="other_typography.html">Typography</a></li>
                        </ul>
                    </li>
                </ul>
                <div class="clear"></div>
            </div>
        </div>
        <!-- Top line ends -->

        <!-- Sidebar begins -->
        <div id="sidebar">
            <div class="mainNav">
                <div class="user">
                    <?php echo $this->Html->image('epcm/user.png') ?>
                    <span>
                        <?php
                        $rolUsuario = $this->Session->read('Auth.User.role');
                        //debug($rolUsuario);
                        switch ($rolUsuario) {
                            case 'admin':
                                echo 'Administrador';
                                break;
                            case 'auxiliar2':
                                echo 'Auxiliar Adm';
                                break;
                            case 'auxiliar':
                                echo 'Auxiliar';
                                break;
                            default:
                                break;
                        }
                        $sucursalUsuario = $this->Session->read('Auth.User.Sucursale.nombre');
                        $idSucursalUsuario = $this->Session->read('Auth.User.Sucursale.id');
                        if($idSucursalUsuario==6)
                            $sucursalUsuario='General';
                        echo "<br />".$sucursalUsuario;
                        ?>                            
                    </span>
                    
                    <span>
                        <?php
                        
                        //debug($rolUsuario);
//                        switch ($sucursalUsuario) {
//                            case 4:
//                                echo 'Finisher';
//                                break;
//                            case 'auxiliar2':
//                                echo 'Auxiliar Adm';
//                                break;
//                            case 'auxiliar':
//                                echo 'Auxiliar';
//                                break;
//                            default:
//                                break;
//                        }
                        ?>                            
                    </span>

                </div>

                <!-- Responsive nav -->
                <div class="altNav">
                    <div class="userSearch">
                        <form action="">
                            <input type="text" placeholder="search..." name="userSearch" />
                            <input type="submit" value="" />
                        </form>
                    </div>

                    <!-- User nav -->

                </div>

                <!-- Main nav -->
                <ul class="nav">
                    <?php
                    $rolUsuario = $this->Session->read('Auth.User.role');
                    //debug($rolUsuario);
                    switch ($rolUsuario) {
                        case 'admin':
                            echo $this->element('sidebar/admin');
                            break;
                        case 'auxiliar2':
                            echo $this->element('sidebar/auxiliar2');
                            break;
                        case 'auxiliar':
                            echo $this->element('sidebar/auxiliar');
                            break;
                        default:
                            break;
                    }
                    ?>                    
                    <?php
                    ?>   <!--   <li><?php echo $this->Html->image("dashboard.png", array("title" => "PRUEBA", 'url' => array('controller' => 'Reportes', 'action' => 'reporte1'))) ?></a></li>-->
                </ul>
            </div>

            <!-- Secondary nav -->
            <?php //echo $this->element('menuordenestags')  ?>
            <?php
            $cadena = $this->here;
            $palabra = 'Reportes';
            if (stristr($cadena, $palabra) != false) {
                echo $this->element('menuforms');
            }
            ?>

        </div>
        <!-- Sidebar ends -->
        <!-- Content begins -->
        <div id="content">
            <?php if ($ruta == '/imprenta/Reportes' || $ruta == '/imprenta/Reportes/index'): ?>
                <div class="contentTop">
                    <span class="pageTitle"><span class="icon-link"></span>Vista de reportes</span>
                    <ul class="quickStats">
                        <li>
                            <a href="" class="blueImg"><img src="images/icons/quickstats/plus.png" alt="" /></a>
                            <div class="floatR"><strong class="blue">5489</strong><span>total trabajos</span></div>
                        </li>
                        <li>
                            <a href="" class="redImg"><img src="images/icons/quickstats/user.png" alt="" /></a>
                            <div class="floatR"><strong class="blue">4658</strong><span>total clientes</span></div>
                        </li>
                        <li>
                            <a href="" class="greenImg"><img src="images/icons/quickstats/money.png" alt="" /></a>
                            <div class="floatR"><strong class="blue">1289</strong><span>total produccion</span></div>
                        </li>
                    </ul>
                    <div class="clear"></div>
                </div>

                <!-- Breadcrumbs line -->
                <div class="breadLine">
                    <div class="bc">
                        <ul id="breadcrumbs" class="breadcrumbs">
                            <li><a href="<?php echo $this->Form->url(array('controller' => 'Reportes', 'action' => 'index')) ?>">Principal</a></li>
                            <li><a href="<?php echo $this->Form->url(array('controller' => 'Reportes', 'action' => 'index')) ?>">Reportes</a>
                                <ul>
                                    <li><a href="form_validation.html" title="">Validation</a></li>
                                    <li><a href="form_editor.html" title="">File uploader &amp; WYSIWYG</a></li>
                                    <li><a href="form_wizards.html" title="">Form wizards</a></li>
                                </ul>
                            </li>
                            <li class="current"><a href="forms.html" title="">Inputs &amp; elements</a></li>
                        </ul>
                    </div>

                    <div class="breadLinks">
                        <ul>
                            <li><a href="#" title=""><i class="icos-list"></i><span>Orders</span> <strong>(+58)</strong></a></li>
                            <li><a href="#" title=""><i class="icos-check"></i><span>Tasks</span> <strong>(+12)</strong></a></li>
                            <li class="has">
                                <a title="">
                                    <i class="icos-money3"></i>
                                    <span>Invoices</span>
                                    <span><img src="images/elements/control/hasddArrow.png" alt="" /></span>
                                </a>
                                <ul>
                                    <li><a href="#" title=""><span class="icos-add"></span>New invoice</a></li>
                                    <li><a href="#" title=""><span class="icos-archive"></span>History</a></li>
                                    <li><a href="#" title=""><span class="icos-printer"></span>Print invoices</a></li>
                                </ul>
                            </li>
                        </ul>
                        <div class="clear"></div>
                    </div>
                </div>
            <?php else: ?>
                <div class="contentTop">

                    <span class="pageTitle"><span class="icon-grid-view"></span>BIENVENIDOS AL SISTEMA GENERAL INTERNACIONAL</span>

                    <div class="clear"></div>
                </div>
                <!-- Breadcrumbs line -->
                <div class="breadLine">
                    <div class="bc">
                        <?php
                        $rolUsuario = $this->Session->read('Auth.User.role');
                        //debug($rolUsuario);
                        switch ($rolUsuario) {
                            case 'admin':
                                echo $this->element('menu/admin');
                                break;
                            case 'auxiliar2':
                                echo $this->element('menu/auxiliar2');
                                break;
                            case 'auxiliar':
                                echo $this->element('menu/auxiliar');
                                break;
                            default:
                                break;
                        }
                        ?>                        
                    </div>

                </div>
            <?php endif; ?>
            <!-- Main content -->
            <div class="wrapper">
                <!--<ul class="middleNavR">
                    <li><a href="#" title="Add an article" class="tipN"><img src="images/icons/middlenav/create.png" alt="" /></a></li>
                    <li><a href="#" title="Upload files" class="tipN"><img src="images/icons/middlenav/upload.png" alt="" /></a></li>
                    <li><a href="#" title="Add something" class="tipN"><img src="images/icons/middlenav/add.png" alt="" /></a></li>
                    <li><a href="#" title="Messages" class="tipN"><img src="images/icons/middlenav/dialogs.png" alt="" /></a><strong>8</strong></li>
                    <li><a href="#" title="Check statistics" class="tipN"><img src="images/icons/middlenav/stats.png" alt="" /></a></li>
                </ul>-->
                <!-- Full width grid element -->
                <div class="fluid" id="contenedor">                    
                    <?php echo $this->Session->flash(); ?>                                  
                    <?php echo $this->fetch('content'); ?>    
                </div>
                <p></p> <p></p> <p></p>
                <div style="text-align: center; color:gray;">
                    <p class="f-left">&copy; 2013 <strong class="green">General Internacional SRL.</strong>, Todos Los Derechos Reservados &reg;</p>
                    <p class="f-right">Dise&ntilde;ado y Desarrollado por la Consultora <a href="http://www.labware.com.bo/">LabWare</a></p>
                </div>               

            </div>
            <!-- Main content ends -->
            <?php //echo $this->element('sql_dump');  ?>
        </div>
        <!-- Content ends -->

    </body>
</html>
